<%--jsp获取controller层必加不然找到不到get方法--%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Jq测试</title>
<%--    引入本地静态资源--%>
    <script src="${pageContext.request.contextPath}/static/js/jquery-3.5.1.js"></script>
    <script>
        function a(){
            $.post({
                url:"${pageContext.request.contextPath}/a1",
                data:{"name":$("#username").val()},
                success:function (data,status){
                    console.log("data:"+data);
                    console.log("status:"+status);
                }
            })
        }
    </script>
</head>
<body>
    用户名：<input type="text" id="username" onblur="a()">
</body>
</html>
